<!DOCTYPE html>
<html lang="zh-CN">
 <head> 
<#include "../head.html" />
<link href="${base}/res/bootstrap/css/bootstrap-spinner.css" rel="stylesheet">
<script src="${base}/res/bootstrap/js/jquery.spinner.min.js"></script>
<#import "../layout/page.html" as allBase>
 </head> 
 <body>
<#include "../layout/top.html" />
<div class="container bs-docs-container"> 
  <div class="row">
	<#include "../layout/left-menu.html" />
	<div class="col-md-9" role="main">
		<div class="alert alert-info" id="tb_num">
		功能：<a href="${base}/user/addOneCode"><span class="glyphicon glyphicon-plus"></span> 添加一个邀请码</a>
		</div>
		<form id="optionConditionForm" action="${base}/user/icm" method="post">
			<input id="pageNumber" type="hidden" name="pageNumber" value="${page.pageNumber}" />
		</form>	
			<div class="table-responsive">
			<form action="" method="post">
				<table class="table table-hover">
					<thead>
						<tr>
							<th>序号</th>
							<th>邀请码</th>
							<th>使用状态</th>
							<th>使用人</th>
							<th>邀请码状态</th>
							<th>操作</th>
						</tr>
					</thead>
					<tbody>
					<#assign x=(page.pageNumber-1)*page.pageSize+1>
					<#list page.list as bean>
						<tr>
						<td>
							${x}
						</td>
						<td class="wrap">${bean.code}</td>
						<td>
							<#if bean.isUsed?? && bean.isUsed>
								<span class="label label-success">已使用</span>
							<#else>
								<span class="label label-default">未使用</span>
							</#if>
						</td>
						<td>${(bean.userName)!}</td>
						<td>
							<#if bean.isValid?? && bean.isValid>
								<span class="label label-success">有效</span>
							<#else>
								<span class="label label-danger">无效</span>
							</#if>
						</td>
						<td>
							<a href="${base}/user/valid?guid=${bean.guid}">
							<#if bean.isValid?? && bean.isValid>
								<span class="glyphicon glyphicon-remove"></span>
							<#else>
								<span class="glyphicon glyphicon-ok"></span>
							</#if>
							</a>
						</td>
						</tr>
						<#assign x=x+1>
					</#list>
					</tbody>
				</table>
				</form>
			</div>
			<@allBase.pagination/>
	</div>
  </div>
 </div>
 <script type="text/javascript">
 function pagination(pageNumber) {
	$("#pageNumber").val(pageNumber);
	$("#optionConditionForm").submit();
}
 </script>
 </body>
</html>